Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0.4xx] Multi-arch OCI images export as tarballs #46467

Merged
merged 54 commits into from
Feb 11, 2025

Conversation

surayya-MS
Copy link
Member

@surayya-MS surayya-MS commented Feb 2, 2025

Context

Fixes dotnet/sdk-container-builds#609

This is a feature request from partner team - support publishing multi-arch OCI image as one combined tarball. Currently we publish separate tarballs for each architecture.

Customer impact

Without this feature customers will not be able to export multi-arch OCI image as one combined tarball, they will get separate tarballs for each architecture, and will have to combine them manually to achieve this.

Details

Current behavior for multi-arch image publishing

  • remote registry - create single-arch image for each arch and publish them to the remote registry, then create image index based on them and load to remote registry
  • local daemon (docker/podman) - create single-arch image for each arch and publish them to the local daemon
  • tarball - create single-arch image for each arch and publish them as separate tarballs

Behaviour after this PR

  • remote registry - create single-arch image for each arch and publish them to the remote registry, then create image index based on them and load to remote registry (same as before)
  • local daemon (docker) - create one multi-arch image and publish it to the local daemon
  • local daemon (podman) - create single-arch image for each arch and publish them to the local daemon (same as before; support for podman will be added in the future)
  • tarball - create one multi-arch image and publish it as a tarball

Note: in order to load a multi-arch oci image tarball, containerd image store should be enabled for Docker.

Changes made

  1. Added support for multi-arch OCI tarballs creation in DockerCli.
  2. Refactored the code to extract publishing logic from CreateNewImage task into a separate class, to be able to reuse it in CreateImageIndex task.
  3. Added SkipPublishing parameter in CreateNewImage task, in order to create an image but skip publish it (this is needed for multi-arch tarball publishing because we need to publish one combined tarball)
  4. More refactoring

Testing

Modified end to end multi-arch tests to reflect the new behavior. Tested manually as well.

Risks

Low - new tests ensure the scenarios are now covered, the existing tests ensure that other scenarios were not affected.

@surayya-MS surayya-MS requested a review from a team as a code owner February 2, 2025 19:30
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member labels Feb 2, 2025
@surayya-MS surayya-MS added DO NOT MERGE and removed untriaged Request triage from a team member labels Feb 2, 2025
@surayya-MS surayya-MS changed the title Multi-arch OCI images export as tarballs [release/8.0.4xx] Multi-arch OCI images export as tarballs Feb 8, 2025
Surayya Huseyn Zada added 3 commits February 10, 2025 09:17
…postory contains /, and 'docker.io/library/' when it doesn't; add tests
… rename DockerIsAvailableAndSupportsArchFactAttribute file
@baronfel
Copy link
Member

I've done all my testing and am very happy with the changes here! Thanks for pushing this to done, @surayya-MS

@surayya-MS
Copy link
Member Author

A test is failing on macos leg - which is unrelated to the changes in this PR.

@marcpopMSFT could you please merge this on red, once tactics approve the PR?
Also, could you please remove co-author from squash commit [email protected]? I just noticed I haven't set git config correctly.

@marcpopMSFT
Copy link
Member

It's currently marked for do not merge and still servicing-consider. I can merge once it's approved. The Mac issue is #46006 and still waiting on a fix from Runtime.

@baronfel
Copy link
Member

@marcpopMSFT this was just approved over email - mind merging when you have a moment?

@marcpopMSFT marcpopMSFT merged commit e78c097 into dotnet:release/8.0.4xx Feb 11, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality Servicing-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants